﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Services;

public partial class Admin_Introductions : System.Web.UI.Page
{
    IntroductionController introduction = new IntroductionController();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            grvIntro.DataSource = introduction.GetAll();
            grvIntro.DataBind();
            if (grvIntro.Rows.Count > 0)
            {
                grvIntro.UseAccessibleHeader = true;
                grvIntro.HeaderRow.TableSection = TableRowSection.TableHeader;
            }
        }
    }
    [WebMethod]
    public static string deleteIntro(int id)
    {
        IntroductionController introduction = new IntroductionController();
        if(introduction.Delete(id)>0)
        {
            return "Xóa Giới thiệu thành công";
        }
        else
        {
            return "Xóa Giới thiệu gặp lỗi";
        }
    }
}